import {defineAsyncComponent, ref} from "vue";

export let currentRoleIndex = ref(5)
export const navigatorDict = {
    1: defineAsyncComponent(()=> import('../components/NavigatorRoot.vue')),
    2: defineAsyncComponent(()=> import('../components/NavigatorAssign.vue')),
    3: defineAsyncComponent(()=> import('../components/NavigatorCheck.vue')),
    4: defineAsyncComponent(()=> import('../components/NavigatorSubmit.vue')),
    5: defineAsyncComponent(()=> import('../components/NavigatorTourist.vue')),
}

export function findUserRole(roles:[]){
    if(roles.includes('超级管理员')){
        return 1
    }else if(roles.includes('任务发布人')){
        return 2
    }else if(roles.includes('审核人')){
        return 3
    }else if(roles.includes('实施人')){
        return 4
    }else{
        return 5
    }
}